<?php
require_once 'top/TopClient.php';
require_once 'top/RequestCheckUtil.php';
require_once 'top/request/DeliveryTemplateGetRequest.php';

$secretKey = trim($_POST['secretKey']);
$appkey = trim($_POST['appkey']);
$templateId = trim($_POST['templateId']);
$userNick = trim($_POST['userNick']);
if ($templateId) {
	$rep = new DeliveryTemplateGetRequest();
	$rep->setFields('template_id,template_name,created,modified,supports,assumer,valuation,query_express,query_ems,query_cod,query_post');
	$rep->setTemplateIds($templateId);
	$rep->setUserNick($userNick);
	
	$client = new TopClient();
	$client->appkey = $appkey;
	$client->secretKey = $secretKey;
	
	$resp = $client->execute($rep);
	echo($resp);
	
}
exit;